package com.zhongkeruan.user.dao;

import com.zhongkeruan.common.model.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author yangyao
 * @Description: UserDao
 * @date 2019/1/11 15:14
 */
@Mapper
public interface UserDao {

    public List<User> getUserList() throws Exception;

    public User getUserById(@Param("id") Long id) throws Exception;

    /**
     * 根据用户名查询
     * @param userName
     * @return
     * @throws Exception
     */
    public User findByUserName(@Param("userName") String userName) throws Exception;

    /**
     * 新增用户
     * @param user
     * @return
     * @throws Exception
     */
    public int addUser(User user) throws Exception;
}
